package com.chapter10.designmodel;

public class Lazy {

    private String name;

    //构造器私有化
    private Lazy(String name) {
        this.name = name;
    }

    //创建私有属性,但是不能new，否则成饿汉式
    private static Lazy instance;
    //？？？

    //公共方法接口判断对象
    public static Lazy getInstance() {
        if (instance == null) {
            instance = new Lazy("Lazy");
        }
        return instance;
    }

}
